package com.ray.pojo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Auther: 李宇航
 * @Date: 2018/10/30 0030 17:11
 * @Description:设备信息详情
 */
@Data
public class EquipmentDetail {
    private String equipmentNo;
    private List<String> orderNos;
    private double dayUseRate;
    private int dayYield;

    public String packageAsWeChatMessage() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.equipmentNo).append("\n");
        for (String orderNo : orderNos) {
            sb.append("订单编号：").append(orderNo).append("\n");
        }
        sb.append("日利用率：").append(new BigDecimal(dayUseRate).setScale(2,BigDecimal.ROUND_HALF_UP) + "%").append("\n")
                .append("昨日产能：").append(dayYield).append("\n\n");
        return sb.toString();
    }
}
